package o;

import com.google.android.exoplayer2.ParserException;
import java.util.ArrayList;
import java.util.List;
import o.and.e;

public final class anw {
    public final float ˊ;
    public final List<byte[]> ˋ;
    public final int ˎ;
    public final int ˏ;
    public final int ॱ;

    public static anw ॱ(anc o_anc) throws ParserException {
        int i = -1;
        int i2 = 0;
        try {
            o_anc.ˎ(4);
            int ʽ = (o_anc.ʽ() & 3) + 1;
            if (ʽ == 3) {
                throw new IllegalStateException();
            }
            int i3;
            List arrayList = new ArrayList();
            int ʽ2 = o_anc.ʽ() & 31;
            for (i3 = 0; i3 < ʽ2; i3++) {
                arrayList.add(ˊ(o_anc));
            }
            i3 = o_anc.ʽ();
            while (i2 < i3) {
                arrayList.add(ˊ(o_anc));
                i2++;
            }
            float f = 1.0f;
            if (ʽ2 > 0) {
                e ˏ = and.ˏ((byte[]) arrayList.get(0), ʽ, ((byte[]) arrayList.get(0)).length);
                i3 = ˏ.ˎ;
                i = ˏ.ʼ;
                f = ˏ.ʽ;
            } else {
                i3 = -1;
            }
            return new anw(arrayList, ʽ, i3, i, f);
        } catch (Throwable e) {
            throw new ParserException("Error parsing AVC config", e);
        }
    }

    private anw(List<byte[]> list, int i, int i2, int i3, float f) {
        this.ˋ = list;
        this.ˎ = i;
        this.ॱ = i2;
        this.ˏ = i3;
        this.ˊ = f;
    }

    private static byte[] ˊ(anc o_anc) {
        int ॱॱ = o_anc.ॱॱ();
        int ˋ = o_anc.ˋ();
        o_anc.ˎ(ॱॱ);
        return amr.ॱ(o_anc.ˏ, ˋ, ॱॱ);
    }
}
